<?php

class Confession_Widget_ConfessionController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {     
   $viewer = Engine_Api::_()->user()->getViewer();

    $table = Engine_Api::_()->getDbtable('actions','activity');
    $select = $table->select()->where('type = "confession_new"')->where('body != ""')->order('action_id DESC')->limit(5);
    $this->view->confessions = $confessions = $table->fetchAll($select);

 	if(count($confessions) <= 0){
	return $this->setNoRender();

  }
} 

}
